<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/pc/jsp/common/common.jsp"%>
<%@ page language="java" import="com.limao.DBDataClass.SysProjectCateDataClass"%>
<%@ page language="java" import="com.limao.DBDataClass.CrowdSysProjectClass"%>
<%@ page language="java" import="com.limao.Model.PublicData"%>

<%String projectid=request.getParameter("projectid");

String selectextraValStr="";

 %>


<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <title>商品详情</title>
	<script src="pc/js/jquery.touchSlider.js"></script>
	<script>
		$(window).load(function() {
			headertabcurrent=1;
			$("#header").load("pc/header.jsp"); 
			$("#footer").load("pc/footer.jsp"); 
			
			//headerTab(1);
		});
	</script>
    <script type="text/javascript">
        $(function(){
            //            进度条
            $(".bar_span").each(function () {
                var ress = $(this).attr('width');
                var len=ress+"%";
                console.log(len);
                $(this).animate({
                    width:len
                });

            });
            
  //            图片滑动
            $(".main_visual2").hover(function(){
                $("#btn_prev,#btn_next").fadeIn()
            },function(){
                $("#btn_prev,#btn_next").fadeOut()
            });

            $dragBln = false;

            $(".main_image2").touchSlider({
                flexible : true,
                speed : 1000,
                btn_prev : $("#btn_prev"),
                btn_next : $("#btn_next"),
                paging : $(".flicking_con a"),
                counter : function (e){
                    $(".flicking_con a").removeClass("on").eq(e.current-1).addClass("on");
                }
            });

            $(".main_image2").bind("mousedown", function() {
                $dragBln = false;
            });

            $(".main_image2").bind("dragstart", function() {
                $dragBln = true;
            });

            $(".main_image a").click(function(){
                if($dragBln) {
                    return false;
                }
            });

            timer = setInterval(function(){
                $("#btn_next").click();
            }, 3500);

            $(".main_visual").hover(function(){
                clearInterval(timer);
            },function(){
                timer = setInterval(function(){
                    $("#btn_next").click();
                },3500);
            });

            $(".main_image2").bind("touchstart",function(){
                clearInterval(timer);
            }).bind("touchend", function(){
                timer = setInterval(function(){
                    $("#btn_next").click();
                }, 3500);
            });

        });
    </script>
    
<script>
var projectidV=1;
var curpageForBuyUser=1;
var taotalPagesForBuyUser=1;

var curpageForChat=1;
var taotalPagesForChat=1;

//
function loadChatList(curpageForChat)
{
	if(curpageForChat==0) return;
	var projectidV=$("#P_projectid").html();
	$.ajax({
            url: "LoginServlet ",
            data: JSON.stringify({m:1540,projectid :projectidV,curpage:curpageForChat}),
            type: 'post',
            dataType: 'json',
            contentType:"application/json;charset=utf-8",
            success: function (data) {
            	console.log(data);
   	           if(data['state']==1)
	           {
	           		curpageForChat=data.curpage*1;
	           		taotalPagesForChat=data.total*1;
	           		
	           		//更新分页
	           		$("#chatPage").html('');
	           		if(taotalPagesForChat>1)
 	           		{
		           		var start=1;
		           		if(curpageForChat-3>1)
		           		{
		           			start=curpageForChat-3;
		           		}
		           		var end=taotalPagesForChat;
		           		if(curpageForChat+3<taotalPagesForChat)
		           		{
		           			end=curpageForChat+3;
		           		}
		           		var ChatPageHtml="";
		           		if(curpageForChat!=1)
		           		{   //上一页
		           			ChatPageHtml='<li> <a href="javascript:loadBuyUserList('+(curpageForChat-1)+');" class="page-up">&lt;&nbsp;上一页</a></li>';
		           		}
		           		for(var i = start;i<end+1;i++)
		           		{
		           			if(i==curpageForChat) //当前页
		           			{
		           				ChatPageHtml=ChatPageHtml+'<li><a href="javascript:void(0);" class="active">'+i+'</a></li>';
		           			}
		           			else
		           			{
		           				ChatPageHtml=ChatPageHtml+'<li><a href="javascript:topicToPage('+i+');">'+i+'</a></li>';
		           			}
		           		}
		           		if(curpageForChat!=taotalPagesForChat)
		           		{   //下一页
		           			ChatPageHtml=ChatPageHtml+'<li><a href="javascript:topicToPage('+(curpageForChat+1)+');" class="page-down">下一页&nbsp;&gt;</a></li>';
		           		}
		           		
						$("#chatPage").html(ChatPageHtml);
	         		}
	                //数据
	           		$("#huaTiDiv").html('');
					var contentHtml="";
					if(data.list==null)  return;
	           		$.each(data.list, function(index, objVal) { //遍历对象数组，index是数组的索引号，objVal是遍历的一个对象。
						contentHtml=contentHtml+	
							'<div class="huaTiFloor">'+
	                            '<p class="huati-name f15 c6">'+objVal.username+'</p>'+
	                            '<p class="huati-time f14 c9 mgt10">'+objVal.ctime+'</p>'+
	                            '<p class="huati-content f16 c3 mgt20 lh15">'+objVal.txt+'</p>'+
	                            '<p class="f14 cursor mgt10 huifuBtn" onclick="replyShow($(this),'+objVal.disscussid+');"><img src="pc/images/duihuakuang.png" class="fl wauto">回复</p>'+
	
	                        '</div>';
	                        var replyConentHtml="";
	                        if(objVal.childlist!=null)
	                        {
		                        $.each(objVal.childlist, function(childIndex, childObjVal) {
			                         replyConentHtml =replyConentHtml+'<div class="replyBlock of">'+
	                                               '<p class="huati-name f15 cblue">'+childObjVal.username+'回复@'+objVal.username+'：</p>'+
	                                               '<p class="huati-time f13 c9 mgt10">'+childObjVal.ctime+'</p>'+
	                                               '<p class="huati-content f16 c3 mgt20 lh15 t2">'+ childObjVal.txt +'</p>'+
	                                               '</div>';
		                        });
		                        contentHtml=contentHtml+replyConentHtml;
	                        }
				    });
	           
	           		$("#huaTiDiv").html(contentHtml);
	           
	           }
       		},
            error: function (data) {
                 return false;
            },
         });	
}
//取支持者列表
function loadBuyUserList(curpageForBuyUser)
{
    if(curpageForBuyUser==0) return;
    var projectidV=$("#P_projectid").html();
    
    
	$.ajax({
            url: "LoginServlet ",
            data: JSON.stringify({m:1530,projectid :projectidV,curpage:curpageForBuyUser}),
            type: 'post',
            dataType: 'json',
            contentType:"application/json;charset=utf-8",
            success: function (data) {
            
            	console.log(data);
   	           if(data['state']==1)
	           {
	           		curpageForBuyUser=data.curpage*1;
	           		taotalPagesForBuyUser=data.total*1;
 	           		//更新分页
 	           		$("#BuyUserPage").html('');
 	           		if(taotalPagesForBuyUser>1)
 	           		{
		           		var start=1;
		           		if(curpageForBuyUser-3>1)
		           		{
		           			start=curpageForBuyUser-3;
		           		}
		           		var end=taotalPagesForBuyUser;
		           		if(curpageForBuyUser+3<taotalPagesForBuyUser)
		           		{
		           			end=curpageForBuyUser+3;
		           		}
		           		var BuyUserPageHtml="";
		           		if(curpageForBuyUser!=1)
		           		{   //上一页
		           			BuyUserPageHtml='<li> <a href="javascript:loadBuyUserList('+(curpageForBuyUser-1)+');" class="page-up">&lt;&nbsp;上一页</a></li>';
		           		}
		           		for(var i = start;i<end+1;i++)
		           		{
		           			if(i==curpageForBuyUser) //当前页
		           			{
		           				BuyUserPageHtml=BuyUserPageHtml+'<li><a href="javascript:void(0);" class="active">'+i+'</a></li>';
		           			}
		           			else
		           			{
		           				BuyUserPageHtml=BuyUserPageHtml+'<li><a href="javascript:topicToPage('+i+');">'+i+'</a></li>';
		           			}
		           		}
		           		if(curpageForBuyUser!=taotalPagesForBuyUser)
		           		{   //下一页
		           			BuyUserPageHtml=BuyUserPageHtml+'<li><a href="javascript:topicToPage('+(curpageForBuyUser+1)+');" class="page-down">下一页&nbsp;&gt;</a></li>';
		           		}
						$("#BuyUserPage").html(BuyUserPageHtml);
					}
					//加载数据
					
					$("#zhichizheBlockDiv").html('');
					var contentHtml="";
					var t=0;
					$.each(data.list, function(index, objVal) { //遍历对象数组，index是数组的索引号，objVal是遍历的一个对象。
						if(index%2==0) 
						{
							contentHtml=contentHtml+'<div class="clearfix of">';
						  	contentHtml=contentHtml+'<div class="zhichizheDiv fl"><img src="'+imgBaseUrl+objVal.avatar+'" class="fl db br50"><div class="fl"><p class="f20 c6 zhichiName">'+objVal.username+'</p><div class="clearfix of zhichiMoney"><p class="f16 c9 fl">支持</p><p class="dib corange f24 fl mgl10"><span>&yen;</span>'+objVal.totalrmb+'</p></div></div></div>';
						}
						if(index%2==1)
						{
							contentHtml=contentHtml+'<div class="zhichizheDiv fr"><img src="'+imgBaseUrl+objVal.avatar+'" class="fl db br50"><div class="fl"><p class="f20 c6 zhichiName">'+objVal.username+'</p><div class="clearfix of zhichiMoney"><p class="f16 c9 fl">支持</p><p class="dib corange f24 fl mgl10"><span>&yen;</span>'+objVal.totalrmb+'</p></div></div></div>';
							contentHtml=contentHtml+'</div>';
						}
						  	
						 t++;
				    });
				    if(t%2==0)
				    {
				    	contentHtml=contentHtml+'</div>';
				    }
					$("#zhichizheBlockDiv").html(contentHtml);
	           }
	        },
            error: function (data) {
                 return false;
            },
         });
}




$().ready(function() {    
    loadBuyUserList(1);
   // loadChatList(1);
  });
        
</script>
</head>
<body  ontouchstart="">
    <!--header-->
	<div  id="header"> </div>
    <div style="display:none">
           <font id="P_projectid"><%=projectid%></font><font id="huaTi_curpage">0</font><font id="huaTi_total">0</font>
           <font id="zhichizhe_curpage">0</font><font id="zhichizhe_total">0</font>
    </div>
	 <!--导航条-->
   	<%  List<SysProjectCateDataClass> CateList= WebFunction.getProjectCate();  %>
    <div class="container jz" style="width: 1220px;padding: 0 10px;">
        <div  class="nav w100">
            <div class="w100 clearfix of">
                <%int index=1; for(SysProjectCateDataClass tmp:CateList){if(index>8) break; %>
                <a href="pc/zhongChouList.jsp?cateid=<%=tmp.cateid%>">
                    <img src="<%=(imgPath+tmp.cateimage)%>" class="navImg keji">
                    <span><%=tmp.catename%></span>
                </a>
                <%index++; } %>
            </div>
        </div>
        <!--nav-->
        
        <!-- 取详细信息 -->
     <%

       CrowdSysProjectClass obj=WebFunction.getProjectInfo(projectid);
       if(obj!=null){
            int stocknum=0; 
			if((CacheClass.getIntValue(obj.limitenum)-CacheClass.getIntValue(obj.supportnum))>0)
			      stocknum=CacheClass.getIntValue(obj.limitenum)-CacheClass.getIntValue(obj.supportnum);
       
       %>
    
        <div class="proView bcf w100 mgt20 of clearfix">
 			<div class="main_visual2 db fl pr">
                <%if(!CacheClass.isEmpty(obj.projectimage)){ String[] imgArr=obj.projectimage.split(";");%>
                <div class="flicking_con of">
                  <%int ind=1;for(String s:imgArr){ %>
                    <a href="#"><%=ind %></a>
				  <%} %>
                </div>
                <div class="main_image2">
                    <ul>
                     <%for(String s:imgArr){ %>
                        <li style="border:1px solid #ebebeb;">
                            <a href="<%=(imgPath+s)%>"><img src="<%=(imgPath+s+pc_home_1)%>" class="db w100 h100" ></a>
                        </li>
                     <%} %>   
                    </ul>
                    <a href="javascript:;" id="btn_prev"></a>
                    <a href="javascript:;" id="btn_next"></a>
                </div>
                
                <%} %>
            </div>           
            
             <div class="fr">
                <p class="f22 c3 mgt10"><%=obj.projectname%></p>
                <div class="w100 dashLine" style="margin-top: 5px;margin-bottom: 5px;"></div>
                <div class="w100 mgt10 clearfix of">
                    <p class="f16 c9 fl">库存</p> <p class="fr f16 c9"><span class="cblue fw600"><%=obj.supportnum%>&nbsp;&nbsp;</span>&nbsp;购买人次</p>
                </div>
                <p class="cred" style="margin-left: 45px;"><span class="f21"></span><span style="font-size: 25px;"><%=stocknum%></span><span class="f25"></span></p>
                <p class="f17 fb c3 mgt18">产品简介格</p>
                <div class="w100 dashLine" style="margin-top: 8px;margin-bottom: 15px;"></div>
                
                <div class="w100 clearfix of" style="min-height:88px;" >
                   <p class="f16 c9 t2 lh18">
                    <%=obj.intro%>
                   </p>
                </div>
                
                <div class="w100 clearfix of mgt18">
                    <p class="f17 fb c3 fl tl">供应商</p>
                 	<a id="licence" onclick="javascript:licenceImgShow();" class="cred f14 lh2 jz aht db fr tr" style="display:none;">>>查看食品流通许可证</a>
                </div>
                <div class="w100 dashLine" style="margin-top: 8px;margin-bottom: 15px;"></div>
                <div class="clearfix of w100">
                    <img src="<%=(imgPath+obj.companylogo.split(";")[0])%>" class="db fl wauto" style="height: 60px">
                    <div class="fl dib" style="margin-left: 14px;">
                        <p class="f16 c3 lh2"><%=obj.companyname%></p>
                        <p class="f13 c9 lh2"><%=obj.address%></p>
                    </div>
                </div>
                <div class="w100 dashLine" style="margin-top: 25px;margin-bottom: 7px;"></div>
                <p class="f16 c9">分享到</p>
                <div class="fenxiang mgt10 w100 clearfix of">
                    <span class="weibo"></span>
                    <span class="tengxunweibo"></span>
                    <span class="kongjian"></span>
                    <span class="douban"></span>
                    <span class="renren"></span>
                    <span class="weixin"></span>
                </div>
            </div>
         </div>


        <div class="w100 clearfix of">
            <div class="proBlockLeft fl">
                <div id="proDetailTab" class="proDetailTab bcf w100 clearfix of f22 c3 tc">
                    <div class="proDetailCurrent">更多详情</div>
                    <div style="display:none"> 话题<span class="f15">(<%=obj.disscussnum %>)</span>
                        <div class="pa" style="width: 1px;height: 27px;background: #e1e1e1;top:20px;left: -0.5px;z-index: 10;"></div>
                        <div class="pa" style="width: 1px;height: 27px;background: #e1e1e1;top:20px;right: -0.5px;z-index: 10;"></div>
                    </div>
                    <div style="display:none">支持者<span class="f15 c9">(<%=obj.supportnum %>)</span></div>
                </div><!--proDetailTab-->
                <div id="proDetailTabDiv" class="proDetailTabDiv bcf of">
                	<!-- 主页 -->
                    <div class="chanpinBlock" style="display: block">
                        <%
                          String[] inigArr=obj.introimage.split(";"); 
                          for(String img:inigArr){
                        %>
                        <div class="of">
                            <img src="<%=(imgPath+img)%>" class="db w100 hauto">
                        </div>
                        <%} %>
                    </div> <!--chanpinBlock-->
                    
                    <!-- 话题 -->
                    <div class="huatiBlock" >
                        <div id="newComment" class="w100 of mgt30">
                            <textarea id="newCommentText" class="newCommentText db f16 c3 lh2 jz" placeholder="请填写您的评论..."></textarea>
                            <p class="w100 cred f14 tc lh2"></p>
                            <div class="w100 clearfix of">
                                <input type="button" name="" value="发表评论" id="newCommentsubBtn" onclick="newComment($(this),$('#newCommentText'))" class="newCommentsubBtn db fr cf tc f20 cursor"/>
                            </div>
                        </div><!--newComment-->
                        
                        <div id="huaTiDiv">
	                        
                        </div>
                        <!-- 分页 -->
                        <div class="c9 f12 lh2 tc mgt30 pageBlock" >
                            <%--<p id="P_projectid" style="display:hide"><%=projectid%></p>--%>
                            <ul class='db fr of' id="chatPage"><li><a href="javascript:topicToPage(3);" class="page-up">上一页</a></li><li><a href="javascript:topicToPage(1);" class='active'>1</a></li><li><a href="javascript:topicToPage(2);">2</a></li><li><a href="javascript:topicToPage(3);">3</a></li><li class="now"><a href="javascript:void(0);">4</a></li><li><a href="javascript:topicToPage(5);">5</a></li><li><a href="javascript:topicToPage(6);">6</a></li><li><a href="javascript:topicToPage(7);">7</a></li><li><a href="javascript:topicToPage(5);" class="page-down">下一页</a></li></ul>
                        </div>
                    </div><!--huatiBlock-->
                    
                    <!-- 支持者 ajax处理 -->
                     
                    <div class="zhichizheBlock">
                        <div class="of" id="zhichizheBlockDiv"></div>

                        <!-- 分页 -->
                        <div class="c9 f12 lh2 tc mgt30 pageBlock">
                        <%--<p id="P_projectid" style="display:hide"><%=projectid%></p>--%>
                            <ul class='db fr of' id="BuyUserPage"></ul>
                        </div>
                    </div><!--zhichizheBlock-->

                </div>
                <script>
                    $(function () {
                        $("#proDetailTab>div").bind('click',function () {
                            $("#proDetailTab>div").removeClass('proDetailCurrent');
                            $(this).addClass('proDetailCurrent');
                            var showInex =  $(this).index();
                            $("#proDetailTabDiv>div").hide();
                            $("#proDetailTabDiv>div").eq(showInex).show();
                        })
                    })

                    //新评论提交与发表
                    function newComment(newCommentsub,newCommentTextarea) {
                        var  newCommentsub = newCommentsub;
                        var  newCommentTextarea = newCommentTextarea;
                        console.log(newCommentTextarea);
                        var newCommentVal = $.trim(newCommentTextarea.val());

                        if(newCommentVal== ""){
                            newCommentTextarea.next('p').text('你还未填写评论');
                            return false;
                        }else {
                            newCommentTextarea.next('p').text('');
                        }
                        
                        var projectidV=$("#P_projectid").html();
						//提交
                        $.ajax({
                             url: "PlugServlet",
				            data: JSON.stringify({m:1640,projectid:projectidV,replayid:0,text:newCommentVal}),
				            type: 'post',
				            dataType: 'json',
				            contentType:"application/json;charset=utf-8",
                            beforeSend: function () {
                                $("#loadingfDiv").fadeIn();
                            },
            				success: function (data) {
                                console.log(data);
                                if (data.state == 1) {
                                	layer.alert(data.info);
			                      /* 
			                       var newCommentHtml = '<div class="huaTiFloor">' +
			                                              ' <p class="huati-name f15 c6">'+username+'</p>'+
			                                              '<p class="huati-time f14 c9 mgt10">'+getLocalDateTime()+'</p>'+
			                                              '<p class="huati-content f16 c3 mgt20 lh15">'+newCommentVal+'</p>'+
			                                              '<p class="f14 cursor mgt10 huifuBtn" onclick="replyShow($(this));"><img src="pc/images/duihuakuang.png" class="fl wauto">回复</p>'+
			                                             '</div><!--huaTiFloor-->';
			                        $("#newComment").after(newCommentHtml);
			                         */
			                        //loadChatList(curpageForChat);
			                        newCommentTextarea.val('');

                                }else{
			                        layer.alert(data.info);
                                }
                            },
                            error: function (data) {
                                layer.alert(data.msg);
                                return false;
                            },
                            complete: function () {
                                $("#loadingfDiv").fadeOut();
                            }
                        });
                    }


                    //                    回复表单出现
                    function replyShow(replyBtn,disscussid) {
                        var replyBtn =replyBtn;
                        var replyForm = '<div id="" class="replyForm bcf mgt20">'+
                                            '<div class="tr clearfix of close-x jz">'+
                                                '<span class="fr f34 c3 cursor" onclick="removeReplyForm($(this));">&times;</span>'+
                                            '</div>'+
                                            '<textarea id="" class="replyConentText db f16 c3 lh2 jz of mgt10" placeholder="回复@路人甲张三疯：..."></textarea>'+
                                            '<p class="w100 cred f14 tc lh2"></p>'+
                                            '<div class="w100 clearfix of mgt20">'+
                                                '<input type="button" name="" value="发表" id="" onclick="replySub($(this),'+disscussid+');" class="replySubBtn db fr cf tc f16 br3 cursor"/>'+
                                            '</div>'+
                                        '</div> <!--replyForm-->';

                        replyBtn.after(replyForm);
                    }


                    //                    回复表单关闭

                    function removeReplyForm(replyClose) {
                        var replyClose = replyClose;
                        var replyFormHtml = replyClose.parents('.replyForm');
                        replyFormHtml.remove();
                    }


                    //                    回复提交并发表

                    function replySub(replySub,disscussid) {
                        var replySub = replySub;
                        var  replyConentText = replySub.parent('div').siblings('.replyConentText');
                        var replyConentTextVal = $.trim(replyConentText.val());
                        console.log(replyConentTextVal);

                        if(replyConentTextVal== ""){
                            replyConentText.next('p').text('你还未填写评论');
                            return false;
                        }else {
                            replyConentText.next('p').text('');
                        }

                        var projectidV=$("#P_projectid").html();
						//提交
                        $.ajax({
                             url: "PlugServlet",
				            data: JSON.stringify({m:1640,projectid:projectidV,replayid:disscussid,text:replyConentTextVal}),
				            type: 'post',
				            dataType: 'json',
				            contentType:"application/json;charset=utf-8",
                            beforeSend: function () {
                                $("#loadingfDiv").fadeIn();
                            },
            				success: function (data) {
                                console.log(data);
                                if (data.state == 1) {
                                	layer.alert(data.info);
			         
			         
			                   /*
		                        var replyConentHtml =  '<div class="replyBlock of">'+
		                                               '<p class="huati-name f15 cblue">发起人回复@路人甲张三疯：</p>'+
		                                               '<p class="huati-time f13 c9 mgt10">2016-9-25  21:39</p>'+
		                                               '<p class="huati-content f16 c3 mgt20 lh15 t2">'+ replyConentTextVal +'</p>'+
		                                                '<!--<p class="f14 cursor mgt10 huifuBtn" onclick="replyShow($(this));" style="margin-bottom: 0;"><img src="pc/images/duihuakuang.png" class="fl wauto">回复</p>-->'+
		                                                '</div> <!--replyBlock-->';
		
		                        replySub.parents('.replyForm').before(replyConentHtml);
		                        */
		                        replyConentText.val('');
		                        replySub.parents('.replyForm').remove();
		                        //loadChatList(curpageForChat);

                                }else{
			                        layer.alert(data.info);
                                }
                            },
                            error: function (data) {
                                layer.alert(data.msg);
                                return false;
                            },
                            complete: function () {
                                $("#loadingfDiv").fadeOut();
                            }
                        });
                       
                    }
                    
                </script>
            </div> <!--proBlockLeft-->

            <div class="proBlockRight fr">
                <div class="zhichiProject bcf of">
                    <div class="clearfix of tittle">
                        <div class="fl cred">
                            <span class="f21">&yen;</span><span class="f34" id="pgprice" ><%=obj.packagepriceAbout%></span><span class="f25"></span>
                        </div>
                        <div class="fr c3 f16" style="margin-top: 8px;">
                            <%=obj.supportnum%>&nbsp;&nbsp;购买人次
                        </div>
                    </div>
                    <div class="zhichiProjectContent">
                       <div class="w100 clearfix of">
                           <p class="fl c3 f16">配送费：<span class="c9 f14">免费</span></p>
                           <p class="fr c3 f16">送vip：<span class="c9 f14"><%=obj.days%>天</span></p>
                       </div>
                        <p class="f17 fb c3 mgt18">规格</p>
                        <div class="w100 dashLine" style="margin-top: 8px;margin-bottom: 15px;"></div>
                        <div id="guiGe" class="payWay2 w100 clearfix of">
                        <%if(CacheClass.isEmpty(obj.extra)){ selectextraValStr="";%>
                           <div class="clearfix of w100">
                                <div class="br3 fl payCurrent">无</div>
                            </div>
                        <%}else{ String[] aStr=obj.extra.split(";"); index=0;selectextraValStr=aStr[0]; for(String s:aStr){%>
                          <%if(index%2==0){%> <div class="clearfix of w100"> <%} %>
                         	<div class="br3 fl <%if(index==0) {%>payCurrent<%}%>"><%=s %></div>
                          <%if(index%2==1){%> </div> <%} %>
                        <%index++; } }%>
                        </div>

                        <p class="f17 fb c3 mgt30">数量</p>
                        <div class="w100 dashLine" style="margin-top: 8px;margin-bottom: 15px;"></div>
                        <div class="countDiv w100 clearfix of" style="margin-left:70px;">
                            <input id="minus" name="" type="button" value="-" style="font-size: 56px;"/>
                            <input id="count" name="" type="text" value="1" onkeyup="value=this.value.replace(/\D+/g,'')" onchange="toTotal();"  class="count br6 bcf fl"/>
                            <input id="add" name="" type="button" value="+" />
                        </div>
<!-- 
						<p class="f17 fb c3 mgt18">支付方式</p>
                        <div class="w100 dashLine" style="margin-top: 8px;margin-bottom: 15px;"></div>
                        <div id="payWay" class="payWay2 w100 clearfix of">
                            <div class="clearfix of">
                                <div class="br3 fl payCurrent">支付宝</div>
                                <div class="br3 fr">微信</div>
                            </div>
                            <div class="clearfix of mgt10 mgb18">
                            	<div class="br3 fl">银联</div>
                                <div class="br3 fr">余额</div>
                            </div>
                        </div> 
-->
  						<div class="w100 dashLine" style="margin-top: 8px;margin-bottom: 15px;"></div>
                        <!--<div class="zhichiProjectButton cf tc db jz cursor" style="display: none">支持&nbsp;&nbsp;<span class="f16">&yen;</span><span class="f25" id="moneyChange">799</span><span class="f15">.00</span></div>-->
                        <div class="zhichiProjectButton cf tc db jz cursor" onclick="Sub(<%=obj.projectid%>);">确定购买  支付&nbsp;&nbsp;<span class="f16">&yen;</span><span class="f25" id="moneyChange"><%=obj.packagepriceAbout%></span><span class="f15"></span></div>
                    	
                    	<form id="buyForm" name="buyForm" method="post" action="PcWebPayServlet"></form>
                    	
                    </div>
                </div> <!--zhichiProject-->
                <div class="zhichiProject bcf of" style='height:auto; display:none' >
                    <div class="clearfix of tittle tc f20 c3">
                        风险说明
                    </div>
                    <div class="zhichiProjectContent c9 f15 lh18" style="margin: 23px 26px 23px;">
                    <p>1. 众筹不是商品交易。支持者根据自己的判断选择、支持众筹项目，与发起人共同实现梦想并获得发起人承诺的回报，众筹存在一定风险。</p>
					<p>2. 七彩云购平台只提供平台网络空间、技术服务和支持等中介服务。七彩云购平台作为居间方，并不是发起人或支持者中的任何一方，众筹仅存在于发起人和支持者之间，使用七彩云购平台台产生的法律后果由发起人与支持者自行承担。</p>
					<p>3. 众筹项目的回报发放、发票开具及其他后续服务事项均由发起人负责。如果发生发起人无法发放回报、延迟发放回报、不提供回报后续服务等情形，您需要直接和发起人协商解决，七彩云购平台对此不承担任何责任。 </p>
					<p>4. 众筹项目一旦支付成功，在众筹期中将不予退款；众筹结束后，若众筹失败将原路退回；若众筹成功，支持者想退款，您需要直接与发起人协商解决，七彩云购平台对此不承担任何责任。</p>

                    </div>
                </div> <!--zhichiProject-->
            </div><!--proBlockRight-->
        </div>
    </div><!--container-->
    
   <%}%>
	<!--footer-->
    <div id="footer" class="footer w100 of"></div>


<div id="loadingfDiv" class="loadingfDiv pf w100 h100 db">
    <div class="w100 h100">
        <img src="pc/images/loading.gif" class="db jz" style="margin-top: 40%;">
    </div>
</div><!--loadinfDiv-->

<script>

var paywayVal=0;

var selectextraVal="<%=selectextraValStr%>";
 
  var licenseimage = '<%=obj.licenseimage%>';
  
   function licenceImgShow(){
         	layer.open({
			  type: 1,
			  area: ['50%', '70%'], //宽高
			  title: '许可证',
			  scrollbar:true,
			  shadeClose: true,
			  content: '<img src="'+getBaseImgUrl(licenseimage)+'"  alt="许可证图" class="w100 hauto"/>'
			});
        }               
                
                          $(function () {
                          /*  商品 增加字段 licenseimage（许可证图）， 当商品为食品类时，且字段不为空，在商品详情里 商家那里有 “查看食品流通许可证”字样 ，点击 后，显示一张图片（licenseimage 字段值）  */
					         if(licenseimage != 'null'&& licenseimage !=""){
					         	$("#licence").css("display","block");
					        }
                               
                                $("#guiGe>div>div").bind('click',function () {
                                    $("#guiGe>div>div").removeClass('payCurrent');
                                    $(this).addClass('payCurrent');
                                    selectextraVal = $('#guiGe .payCurrent').text();
                                })

                                //获得文本框对象
                                var t = $("#count");

                                //数量增加操作
                                $("#add").click(function(){
                                    t.val(parseInt(t.val())+1);
									toTotal();
                                })
                                //数量减少操作
                                $("#minus").click(function(){
                                    if (parseInt(t.val())==1){
                                        return ;
                                    }
                                    t.val(parseInt(t.val())-1);
									toTotal();
                                })

                            })
                            
 function toTotal()
 {
 
    $("#moneyChange").html($.trim($("#count").val())*1.0*$.trim($("#pgprice").html()));
 
 }                           
                            
 function Sub(projectidV) {
         
        var numVal= parseInt($.trim($("#count").val()));
        if(numVal<=0)
        {
        	layer.alert("数量不正确。");
        	return;
        }
        
        location.href="pc/myAddress.jsp?projectid="+projectidV+"&num="+numVal+"&selectextra="+selectextraVal;
        
        /* 
        console.log(paywayVal);
        if(paywayVal<2)
        {
        	layer.alert("暂不支持，请选择  银联支付 或 余额支付  进行测试。");
        	return;
        }       
        
        if(paywayVal==10)
        {
            var contentHtml='';
	        contentHtml=contentHtml+'<input type="hidden" name="projectid" id="projectid" value="'+projectidV+'"/>'+
									'<input type="hidden" name="selectextra" id="selectextra" value="'+selectextraVal+'"/>'+
	 								'<input type="hidden" name="num" id="num" value="'+numVal+'"/>'+
	 								'<input type="hidden" name="about" id="about" value=""/>'+ 
	 								'<input type="hidden" name="paytype" id="paytype" value="'+paywayVal+'"/>';       
	        $("#buyForm").html(contentHtml);
	        document.buyForm.submit();
        }
        else
        {
        	if(paywayVal*1.0==2)
		    {
		        var tempwindow=window.open();
		    }
        	
	         $.ajax({
	            url: "PlugServlet ",
	            data: JSON.stringify({m:1720,projectid :projectidV,selectextra:selectextraVal,num:numVal,about:'',paytype:paywayVal,apptype:0}),
	            type: 'post',
	            dataType: 'json',
	            contentType:"application/json;charset=utf-8",
	            beforeSend: function () {
	                $("#loadingfDiv").fadeIn();
	            },
	            success: function (data) {
	            
	            	console.log(data);
	   	           if(data['state']==1)
		           {
		           		//layer.alert(data.info);
		           		if(data['paytype']*1.0==2)
		           		{
		           			console.log(baseUrl+'pc/unionProPay.jsp?orderid='+data['orderid']);
		           		 	tempwindow.location=baseUrl+'pc/unionProPay.jsp?orderid='+data['orderid'] ;
		           		}
		           		else
		           		{
		           			layer.alert(data.info);
		           		}
		           }
		           else
		           {
		           		layer.alert(data.info);
		           }
	           },
	            error: function (data) {
	                layer.alert(data.msg);
	                return false;
	            },
	            complete: function () {
	                $("#loadingfDiv").fadeOut();
	            }
	        }); 
        }
 
         */
         
       
    }






    //            IE圆角,必须放到最下面！所有js之后！
    if (window.PIE) {
        $('.rounded,.flicking_con a,.proSection .bar_span,.proSection .progress,.blueBtn,.yuanjiao,.br3,.br6').each(function() {
            PIE.attach(this);
        });
    }
    
    
    
    
    
    
    
</script>
</html>